import http from "../utils/request";
// 获取验证码
export let getCaptcha = () => http.get("/users/getCaptcha?v=next")

// 常规登陆
export let loginApi = (username,password) => http.post("/users/login",{
        username,password
})

// 校验验证码
export let verifyCaptcha = captcha => http.get("/users/verifyCaptcha",{
    params:{
        captcha
    }
})

// 获取二维码地址
export let getQrCodeApi = sid =>http.get("/users/getQrcode",{
    params:{
        sid
    }
})

// 微信登入
export let wechatLogin = wechatCode => http.get('/users/wechatLogin',{
    params:{
        wechatCode
    }
})

// 获取vip产品数据
export let vipProduct = category_id => http.get('/product/get_product',{
    params:{
        category_id
    }
})

// 修改用户信息 /users/updateUser

// 手机验证码登入
export let smsLogin = code => http.post("/users/login?type=sms",{
        code
})

// 获取手机验证码
export let getSmsCode = (phoneNumber) => http.post("/sms/send",{
    phoneNumber
})

// 获取所有用户
export const getAllusersApi = () => http.get('/users/getAllUsers')